﻿using System;
class LongestSeqOfStrings
{
    static void Main()
    {
        int matrixSizeRow;
        int matrixSizeVal;
        Console.Write("please enter rows of matrix: ");
        while (true)
        {
            try
            {
                matrixSizeRow = int.Parse(Console.ReadLine());
                break;
            }
            catch (Exception)
            {
                Console.Write("Please re-enter size:");
            }
        }
        Console.Write("please enter vals of matrix: ");
        while (true)
        {
            try
            {
                matrixSizeVal = int.Parse(Console.ReadLine());
                break;
            }
            catch (Exception)
            {
                Console.Write("Please re-enter size:");
            }
        }
        Console.WriteLine();
        string[,] theArray = new string[matrixSizeRow, matrixSizeVal];
        for (int i = 0; i < matrixSizeRow; i++)
        {
            for (int j = 0; j < matrixSizeVal; j++)
            {
                Console.Write("please enter element {0},{1}: ",i,j);
                theArray[i, j] = Console.ReadLine();
            }
        }
        for (int i = 0; i < matrixSizeRow; i++)
        {
            for (int j = 0; j < matrixSizeVal; j++)
            {
                if (j == matrixSizeVal - 1)
                {
                    Console.WriteLine("{0,-2} ", theArray[i, j]);
                }
                else
                {
                    Console.Write("{0,-2} ", theArray[i, j]);
                }
            }
        }
        Console.ReadLine();
    }
}

